﻿/*****
 *  Copyright 2011, Kaven Gagné
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *  http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */

using System;
using Knowledge.DataModel;
using System.Collections.ObjectModel;

namespace Knowledge
{
    public class LinkViewModel : ViewModelBase
    {
        #region Constructors
        public LinkViewModel(kLink link, ArticleViewModel parent)
            : base(parent, false)
        {
            _link = link;
        }
        #endregion //Constructors

        #region Data
        private kLink _link;
        private bool _isChecked;
        #endregion //Data

        #region Presentation Members

        #region LinkID
        public int LinkID
        {
            get
            {
                return _link.LinkID;
            }
            set
            {
                _link.LinkID = value;
                this.OnPropertyChanged("LinkID");
            }
        } 
        #endregion //LinkID

        #region LinkName
        public String LinkName
        {
            get
            {
                return _link.LinkName;
            }
        } 
        #endregion //LinkName

        #region LinkUri
        public Uri LinkUri
        {
            get
            {
                return _link.LinkUri;
            }
        }
        #endregion //LinkUri

        #region IsChecked
        public bool IsChecked
        {
            get
            {
                return _isChecked;
            }
            set
            {
                _isChecked = value;
                this.OnPropertyChanged("IsChecked");
            }
        } 
        #endregion //IsChecked

        #endregion //Presentation Members

        #region Overrides
        protected override void LoadChildren()
        {
        } 
        #endregion //Overrides
    }


    #region Design-Time Data Samples Support
    public class LinkViewModels : ObservableCollection<LinkViewModel> { } 
    #endregion //Design-Time Data Samples Support
}
